package com.renting.common.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.websocket.server.PathParam;

/**
 * Created by Administrator on 2018/4/12.
 */
@Controller
public class CommonController {
    @RequestMapping("v1/general/{entity}/{id}")
    @ResponseBody
    public String common(@PathParam("entity") String entity, @PathParam("id") String id) throws ClassNotFoundException {
        try {
            Object object = Class.forName("User").newInstance();
            System.out.println(object.toString());
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }

        return "Entity:" + entity + " ID:" + id;
    }
}
